package com.ruoyi.web.controller.shop;

import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

/**
 * 商品Controller
 * 
 * @author liuwp
 * @date 2025-11-24
 */
@RestController
@RequestMapping("/shop/shop_address")
public class ShopAddressController extends BaseController
{

    @Autowired
    private RuoYiConfig ruoYiConfig;
    /**
     * 查询商品列表
     */
    @GetMapping("/province")
    public String province()
    {
        String json = null;
        try {
            List<String> lines = Files.readAllLines(Paths.get(ruoYiConfig.getProfile() + "/pca-code.json"), StandardCharsets.UTF_8);
            json = String.join("\n", lines);
        }catch (Exception e){
            e.printStackTrace();
        }

        return json;
    }

}
